import request from '@/utils/request'

/**
 * 用户
 * @param {String} id 
 */
export function queryFamilyMembers(id) {
  return request({
    url: '/userAdmin/selectFamilyMembers/'+id,
    method: 'post',
    data: data
  })
}


/**
 * 用户导出
 * @param {String} id 
 */
export function userExport(data) {
  return request({
    url: '/badu/user/export',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}


/**
 * 用户列表
 * @param {Object} data 
 */ 
export function queryUserPage(query) {
  return request({
    url: '/badu/user/list',
    method: 'get',
    params: query
  })
}


/**
 * 根据积分查询对应用户等级
 * @param {String} score 
 */ 
export function queryLevelName(score) {
  return request({
    url: '/system/level/queryScoreLevel/'+score,
    method: 'get',
  })
}

/**
 * 用户详情
 * @param {String} id 
 */
export function queryUserDetail(id) {
  return request({
    url: '/badu/user/'+id,
    method: 'get'
  })
}

/**
 * 用户
 * @param {Object} data 
 */
export function addUser(data) {
  return request({
    url: '/badu/user',
    method: 'post',
    data: data
  })
}


/**
 * 编辑用户
 * @param {Object} data 
 */
export function editUser(data) {
  return request({
    url: '/badu/user',
    method: 'put',
    data: data
  })
}


/**
 * 删除用户
 * @param {String} ids 
 */
export function deleteUser(ids) {
  return request({
    url: '/badu/user/'+ids,
    method: 'delete',
    data: data
  })
}


/**
 * 修改积分
 * @param {String} ids 
 */
export function editScore(data) {
  return request({
    url: '/badu/user/editScore',
    method: 'put',
    data: data
  })
}


